package shuju;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class getconnection {
	static Connection con;
	static java.sql.Statement sql;
	static ResultSet res;
	private static PreparedStatement sql1;
	public Connection getconnection(){
		try {
			Class.forName("com.mysq.jdbc.Driver");
			try {
				con=DriverManager.getConnection("jdbc:mysql:"+"//127.0.0.1:3306/test", "root", "123456");
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
		
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
